民國86年-105年(1997-2016) 台灣人最常去的地方前十名 (註:本資料已去除「未列名」的部分)
## Warning: package 'readr' was built under R version 3.4.2
## Warning: package 'knitr' was built under R version 3.4.3
## Parsed with column specification:
## cols(
## Year = col_integer(),
## `1` = col_character(),
## `2` = col_character(),
## `3` = col_character(),
## `4` = col_character(),
## `5` = col_character(),
## `6` = col_character(),
## `7` = col_character(),
## `8` = col_character(),
## `9` = col_character(),
## `10` = col_character()
## )
| Year | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| 1997 | 香港 | 日本 | 美國 | 澳門 | 泰國 | 新加坡 | 馬來西亞 | 印尼 | 菲律賓 | 越南 |
| 1998 | 香港 | 日本 | 美國 | 澳門 | 泰國 | 新加坡 | 馬來西亞 | 菲律賓 | 印尼 | 越南 |
| 1999 | 香港 | 澳門 | 日本 | 美國 | 泰國 | 馬來西亞 | 新加坡 | 加拿大 | 越南 | 印尼 |
| 2000 | 香港 | 澳門 | 日本 | 美國 | 泰國 | 馬來西亞 | 新加坡 | 印尼 | 越南 | 加拿大 |
| 2001 | 香港 | 澳門 | 日本 | 泰國 | 美國 | 馬來西亞 | 印尼 | 新加坡 | 越南 | 加拿大 |
| 2002 | 香港 | 澳門 | 日本 | 美國 | 泰國 | 印尼 | 越南 | 新加坡 | 馬來西亞 | 加拿大 |
| 2003 | 香港 | 澳門 | 日本 | 美國 | 泰國 | 印尼 | 越南 | 韓國 | 新加坡 | 馬來西亞 |
| 2004 | 香港 | 日本 | 澳門 | 美國 | 泰國 | 韓國 | 印尼 | 越南 | 馬來西亞 | 新加坡 |
| 2005 | 香港 | 日本 | 澳門 | 美國 | 韓國 | 泰國 | 越南 | 印尼 | 新加坡 | 馬來西亞 |
| 2006 | 香港 | 澳門 | 日本 | 美國 | 韓國 | 泰國 | 越南 | 新加坡 | 印尼 | 馬來西亞 |
| 2007 | 香港 | 日本 | 澳門 | 美國 | 韓國 | 泰國 | 越南 | 印尼 | 新加坡 | 馬來西亞 |
| 2008 | 香港 | 日本 | 澳門 | 美國 | 韓國 | 泰國 | 越南 | 中國大陸 | 印尼 | 新加坡 |
| 2009 | 香港 | 中國大陸 | 日本 | 澳門 | 美國 | 韓國 | 越南 | 泰國 | 印尼 | 馬來西亞 |
| 2010 | 中國大陸 | 香港 | 日本 | 澳門 | 美國 | 韓國 | 泰國 | 越南 | 馬來西亞 | 印尼 |
| 2011 | 中國大陸 | 香港 | 日本 | 澳門 | 韓國 | 美國 | 泰國 | 越南 | 印尼 | 馬來西亞 |
| 2012 | 中國大陸 | 香港 | 日本 | 韓國 | 澳門 | 美國 | 越南 | 泰國 | 新加坡 | 菲律賓 |
| 2013 | 中國大陸 | 日本 | 香港 | 韓國 | 澳門 | 泰國 | 美國 | 越南 | 新加坡 | 馬來西亞 |
| 2014 | 中國大陸 | 日本 | 香港 | 韓國 | 澳門 | 美國 | 泰國 | 越南 | 新加坡 | 馬來西亞 |
| 2015 | 日本 | 中國大陸 | 香港 | 泰國 | 澳門 | 韓國 | 美國 | 越南 | 新加坡 | 馬來西亞 |
| 2016 | 日本 | 中國大陸 | 香港 | 韓國 | 澳門 | 泰國 | 美國 | 越南 | 新加坡 | 馬來西亞 |
民國86年-105年(1997-2016) 台灣人最常去的地方人數變化圖 (註:本資料已去除「未列名」的部分)
## Warning: package 'ggplot2' was built under R version 3.4.2
## Warning: package 'plotly' was built under R version 3.4.2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
## Parsed with column specification:
## cols(
## Year = col_integer(),
## Location = col_character(),
## `number of visitors` = col_integer()
## )
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
觀察97-99的台灣前往東亞地區(亦為前5名)的月資料
library(readr)
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.4.2
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
m2008 <- read_csv("C:/Users/user/Desktop/R/Final Project/Liao/m2008.csv")
## Parsed with column specification:
## cols(
## Location = col_character(),
## Month = col_integer(),
## `number of visitors` = col_number()
## )
m2009 <- read_csv("C:/Users/user/Desktop/R/Final Project/Liao/m2009.csv")
## Parsed with column specification:
## cols(
## Location = col_character(),
## Month = col_integer(),
## `number of visitors` = col_number()
## )
m2010 <- read_csv("C:/Users/user/Desktop/R/Final Project/Liao/m2010.csv")
## Parsed with column specification:
## cols(
## Location = col_character(),
## Month = col_integer(),
## `number of visitors` = col_number()
## )
m2008_2010 <- read_csv("C:/Users/user/Desktop/R/Final Project/Liao/m2008_2010.csv")
## Parsed with column specification:
## cols(
## Location = col_character(),
## Month = col_character(),
## `number of visitors` = col_number()
## )
library(ggplot2)
library(plotly)
gp=ggplot(m2008,mapping = aes(x=Month, y=`number of visitors`))+
geom_line(mapping = aes(color=Location))+
scale_x_continuous(limits=c(1,12) ,breaks=1:12)+
scale_y_continuous(breaks=seq(0, 300000, by=20000))+
labs(title = "民國97年(2008) 台灣人前往東亞地區月資料")
ggplotly(gp)
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
gp=ggplot(m2009,mapping = aes(x=Month, y=`number of visitors`))+
geom_line(mapping = aes(color=Location))+
scale_x_continuous(limits=c(1,12) ,breaks=1:12)+
scale_y_continuous(breaks=seq(0, 300000, by=20000))+
labs(title = "民國98年(2009) 台灣人前往東亞地區月資料")
ggplotly(gp)
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
gp=ggplot(m2010,mapping = aes(x=Month, y=`number of visitors`))+
geom_line(mapping = aes(color=Location))+
scale_x_continuous(limits=c(1,12) ,breaks=1:12)+
scale_y_continuous(breaks=seq(0, 300000, by=20000))+
labs(title = "民國99年(2010) 台灣人前往東亞地區月資料")
ggplotly(gp)
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
mlabels=unique(m2008_2010$Month)
m2008_2010$Month = factor(m2008_2010$Month, labels=mlabels, ordered=T)
gp=ggplot(m2008_2010,mapping = aes(x=Month, y=`number of visitors`, group=Location))+
# geom_line() +
geom_line(mapping = aes(color=Location))+
#scale_x_continuous(limits=c(1,36) ,breaks=1:36)+
scale_y_continuous(breaks=seq(0, 300000, by=20000))+
labs(title = "民國97-99年(2008-2010) 台灣人前往東亞地區月資料")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))
ggplotly(gp)
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
library(readr)
library(dplyr)
library(ggplot2)
library(plotly)
China08_17 <- read_csv("C:/Users/user/Desktop/R/Final Project/Liao/China08_17.csv")
## Parsed with column specification:
## cols(
## Month = col_character(),
## Location = col_character(),
## `number of visitors` = col_number()
## )
mlabels=unique(China08_17$Month)
China08_17$Month = factor(China08_17$Month, labels=mlabels, ordered=T)
gp=ggplot(China08_17,mapping = aes(x=Month, y=`number of visitors`, group=Location))+
geom_line(mapping = aes(color=Location))+
geom_smooth(method="lm",formula=y~poly(x, 3),color="skyblue")+
scale_y_continuous(breaks=seq(0, 450000, by=30000))+
labs(title = "民國97-106年(2008-now)台灣人前往中國的月資料")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))
ggplotly(gp)
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`
觀察過去五、六年台灣最常去的地區月資料
library(readr)
library(ggplot2)
library(plotly)
newm2012_2017 <- read_csv("C:/Users/user/Desktop/R/Final Project/Liao/newm2012_2017.csv")
## Warning: Missing column names filled in: 'X2' [2], 'X6' [6], 'X7' [7],
## 'X8' [8], 'X9' [9], 'X10' [10], 'X11' [11], 'X12' [12], 'X13' [13],
## 'X14' [14], 'X15' [15], 'X16' [16], 'X17' [17]
## Parsed with column specification:
## cols(
## Year = col_character(),
## X2 = col_character(),
## Month = col_character(),
## Location = col_character(),
## `number of visitors` = col_number(),
## X6 = col_character(),
## X7 = col_character(),
## X8 = col_character(),
## X9 = col_character(),
## X10 = col_character(),
## X11 = col_character(),
## X12 = col_character(),
## X13 = col_character(),
## X14 = col_character(),
## X15 = col_character(),
## X16 = col_character(),
## X17 = col_character(),
## 小計 = col_number()
## )
mlabels=unique(newm2012_2017$Month)
newm2012_2017$Month = factor(newm2012_2017$Month, labels=mlabels, ordered=T)
gp=ggplot(newm2012_2017,mapping = aes(x=Month, y=`number of visitors`, group=Location))+
geom_line(mapping = aes(color=Location))+
scale_y_continuous(breaks=seq(0, 450000, by=30000))+
labs(title = "民國101-106年(2012-2017) 台灣人最常前往的地區月資料")+
theme(axis.text.x = element_text(angle = 90, hjust = 1))
ggplotly(gp)
## We recommend that you use the dev version of ggplot2 with `ggplotly()`
## Install it with: `devtools::install_github('hadley/ggplot2')`